<template>
  <div class="render-props-fun">
    <div class="mb-20">
      <p v-for="item in items" @click="itemCheck(item)" :key="item.id">
        {{ item }}
      </p>
    </div>
  </div>
</template>
<script lang="ts">
import { Component, Vue, Prop, Emit } from "vue-property-decorator";
@Component
export default class RenderPropsFun extends Vue {
  @Prop()
  private items!: Array<any>;

  //易错点:使用ts进行emit事件派发时,不可以采用驼峰传递(即: item-check)
  @Emit("itemCheck")
  private itemCheck() {}
}
</script>
<style lang="stylus" scoped>
.render-props-fun {
  .title {
    font-size: 12px
    font-weight: 700
    color: #f19000
  }
  .text {
    font-size: 12px
    font-weight: 700
    color: red
  }
}
</style>
